package com.yukefms.common;

import java.util.List;

/**
 * @Description
 * @Author Ping
 * @Date 2021/6/29 11:32
 **/
public class ListTools {
    /**
     * add elements from {@code other} to the list {@code target} with out duplication.
     * @param target
     * @param other
     * @param <T>
     */
    public static <T> void addAllNoDumplicate(List<T> target, List<T> other) {
        for (T t : other) {
            if (! target.contains(t)) {
                target.add(t) ;
            }
        }
    }
}
